home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pcv05n10.zip
/
RECYCL.ZIP
/
DRAGDROP.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-03-26
|
2KB
|
84 lines
DefInt A-Z
Sub Main ()
PM_NOREMOVE = 0
PM_NOYIELD = 2
wRemoveMsg = PM_NOREMOVE Or PM_NOYIELD
Recycler.Show
FixTitle
Handle = Recycler.hwnd
FileNum = -1
DragAcceptFiles Handle, True
Do While DoEvents()
x = PeekMessage(NewMessage, Handle, 563, 563, wRemoveMsg)
If x <> 0 Then
Screen.Mousepointer = 11
Recycler.List1.visible = FALSE
Beep
x = DragQueryFile(NewMessage.wParam, FileNum, NameOfFile, 128)
For Counter = 0 To x - 1
y = DragQueryFile(NewMessage.wParam, Counter, NameOfFile, 128)
If IsFileHidden(NameOfFile) = 0 Then
N = HideFile(NameOfFile, True)
If N = 0 Then
Recycler.List1.AddItem NameOfFile
Else
Fail$ = NameOfFile
MsgBox ("Couldn't add " + Fail$): Fail$ = ""
End If
If Recycler.List1.Listcount = 1 Then Recycler.Icon = LoadPicture("RECFULL.iCO")
End If
Next Counter
Recycler.List1.visible = True
FixTitle
dragfinish NewMessage.wParam
Screen.Mousepointer = 0
End If
Loop
End Sub
Function HideFile (FileToHide$, Hiding)
If Hiding = True Then plusmin$ = "+": Else plusmin$ = "-"
CurPath$ = CurDir$
N = CheckForDir(FileToHide$)
If N <> 0 Then HideFile = 1: Exit Function
HideFile = SetFileHidden(FileToHide$, plusmin$)
End Function
Sub FixTitle ()
FixSize
kb& = TotSize / 1024
LI = Recycler.List1.Listcount
Recycler.Label1.Caption = Str$(LI) + " files in Recycler. " + Str$(TotSize) + " bytes"
If LI = 0 Or Recycler.Windowstate <> 1 Then Recycler.Caption = "Recycler": Exit Sub
If LI = 1 Then Recycler.Caption = "Recycler 1-file" + Str$(kb&) + " KB": Exit Sub
Recycler.Caption = "Recycler " + Str$(LI) + "-files" + Str$(kb&) + " KB"
End Sub
'
Sub FixSize ()
TotSize = 0
For x = 0 To Recycler.List1.Listcount - 1
Temp = FreeFile
F$ = Recycler.List1.List(x)
If CheckForDir(F$) <> 0 Then GoTo Skip
Open Recycler.List1.List(x) For Input As Temp
TotSize = TotSize + LOF(Temp)
Close Temp
Skip:
Next x
End Sub
Function CheckForDir (FileToHide$)
Searchpath$ = Environ$("PATH")
Result$ = String$(129, 0)
CheckForDir = FindFile(FileToHide$, Searchpath$, Result$)
End Function